<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!-- header -->
<jsp:include page="../include/header.jsp"></jsp:include>
<header id="header">

	<!--/header-middle-->
	<jsp:include page="../include/header_middle.jsp"></jsp:include>

	<!--header-bottom-->
	<jsp:include page="../include/header_bottom.jsp"></jsp:include>
	<!--/header-bottom-->

</header>
<!--/header-->

<section>
	<div class="container">
		<div class="row">
			<div class="col-sm-2">
				
			</div>

			<div class="col-sm-9 padding-right" align="center">
				<!--각자 삽입할 부분-->
				<h3>나의 주문 내역</h3>
				<!-- 추후 이미지로 대체 -->
				<table class="table table-striped">
					<tr align="center">
						<td>주문번호</td>
						<td>결제방식</td>
						<td>결제금액</td>
						<td>주문일</td>
					</tr>


					<c:forEach items="${beans }" var="list">
						<tr align="center">
							<td><a href="#" onclick="showDetail(${ list.orders_no })">${ list.orders_no }</a></td>
							<td>${ list.orders_payments }</td>
							<td><fmt:formatNumber value="${ list.orders_price }" pattern=",###"/>원</td>
							<td>${ list.orders_date }</td>
						</tr>
					</c:forEach>
				</table>
				
				<br/>
				${ label }
				
				<br/>
				<br/>
				<br/>
				<!--삽입 끝 -->
			</div>
		</div>
	</div>
</section>

<script type="text/javascript">
	function showDetail(o_no){
		var form = document.createElement("form");
		form.setAttribute("method","post");
		form.setAttribute("action","view");
		document.body.appendChild(form);
		
		var input_no = document.createElement("input");
		input_no.setAttribute("type", "hidden");
		input_no.setAttribute("name", "o_no");
		input_no.setAttribute("value", o_no);
		form.appendChild(input_no);
		
		form.submit();  
	}
</script>
<!--Footer-->
<jsp:include page="../include/footer.jsp"></jsp:include>
<!--/Footer-->
